﻿namespace WinnerCMS.Common.Security.CodeCharts
{
    using Security;
    using System;
    using System.Collections;

    internal static class LowerMiddle
    {
        public static IEnumerable Balinese()
        {
            return CodeChartHelper.GetRange(0x1b00, 0x1b7c, i => (i >= 0x1b4c) && (i <= 0x1b4f));
        }

        public static IEnumerable Buginese()
        {
            return CodeChartHelper.GetRange(0x1a00, 0x1a1f, delegate (int i) {
                if (i != 0x1a1c)
                {
                    return i == 0x1a1d;
                }
                return true;
            });
        }

        public static IEnumerable Buhid()
        {
            return CodeChartHelper.GetRange(0x1740, 0x1753);
        }

        public static IEnumerable Cherokee()
        {
            return CodeChartHelper.GetRange(0x13a0, 0x13f4);
        }

        public static IEnumerable CombiningDiacriticalMarksSupplement()
        {
            return CodeChartHelper.GetRange(0x1dc0, 0x1dff, i => (i >= 0x1de7) && (i <= 0x1dfc));
        }

        public static IEnumerable Ethiopic()
        {
            return CodeChartHelper.GetRange(0x1200, 0x137c, i => ((((((i == 0x1249) || (i == 0x124e)) || ((i == 0x124f) || (i == 0x1257))) || (((i == 0x1259) || (i == 0x125e)) || ((i == 0x125f) || (i == 0x1289)))) || ((((i == 0x128e) || (i == 0x128f)) || ((i == 0x12b1) || (i == 0x12b6))) || (((i == 0x12b7) || (i == 0x12bf)) || ((i == 0x12c1) || (i == 0x12c6))))) || ((((i == 0x12c7) || (i == 0x12d7)) || ((i == 0x1311) || (i == 0x1316))) || (i == 0x1317))) || ((i >= 0x135b) && (i <= 0x135e)));
        }

        public static IEnumerable EthiopicSupplement()
        {
            return CodeChartHelper.GetRange(0x1380, 0x1399);
        }

        public static IEnumerable Georgian()
        {
            return CodeChartHelper.GetRange(0x10a0, 0x10fc, i => (i >= 0x10c6) && (i <= 0x10cf));
        }

        public static IEnumerable HangulJamo()
        {
            return CodeChartHelper.GetRange(0x1100, 0x11ff);
        }

        public static IEnumerable Hanunoo()
        {
            return CodeChartHelper.GetRange(0x1720, 0x1736);
        }

        public static bool IsFlagSet(LowerMidCodeCharts flags, LowerMidCodeCharts flagToCheck)
        {
            return ((flags & flagToCheck) != LowerMidCodeCharts.None);
        }

        public static IEnumerable Khmer()
        {
            return CodeChartHelper.GetRange(0x1780, 0x17f9, i => ((i == 0x17de) || (i == 0x17df)) || ((i >= 0x17ea) && (i <= 0x17ef)));
        }

        public static IEnumerable KhmerSymbols()
        {
            return CodeChartHelper.GetRange(0x19e0, 0x19ff);
        }

        public static IEnumerable LatinExtendedAdditional()
        {
            return CodeChartHelper.GetRange(0x1e00, 0x1eff);
        }

        public static IEnumerable Lepcha()
        {
            return CodeChartHelper.GetRange(0x1c00, 0x1c4f, i => ((i >= 0x1c38) && (i <= 0x1c3a)) || ((i >= 0x1c4a) && (i <= 0x1c4c)));
        }

        public static IEnumerable Limbu()
        {
            return CodeChartHelper.GetRange(0x1900, 0x194f, delegate (int i) {
                if ((((((i != 0x191d) && (i != 0x191e)) && (i != 0x191f)) && ((i < 0x192c) || (i > 0x192f))) && ((i < 0x193c) || (i > 0x193f))) && ((i != 0x1941) && (i != 0x1942)))
                {
                    return i == 0x1943;
                }
                return true;
            });
        }

        public static IEnumerable Mongolian()
        {
            return CodeChartHelper.GetRange(0x1800, 0x18aa, i => ((i == 0x180f) || ((i >= 0x181a) && (i <= 0x181f))) || ((i >= 0x1878) && (i <= 0x187f)));
        }

        public static IEnumerable Myanmar()
        {
            return CodeChartHelper.GetRange(0x1000, 0x109f);
        }

        public static IEnumerable NewTaiLue()
        {
            return CodeChartHelper.GetRange(0x1980, 0x19df, delegate (int i) {
                if (((i < 0x19ac) || (i > 0x19af)) && ((i < 0x19ca) || (i > 0x19cf)))
                {
                    return (i >= 0x19db) && (i <= 0x19dd);
                }
                return true;
            });
        }

        public static IEnumerable Ogham()
        {
            return CodeChartHelper.GetRange(0x1680, 0x169c);
        }

        public static IEnumerable OlChiki()
        {
            return CodeChartHelper.GetRange(0x1c50, 0x1c7f);
        }

        public static IEnumerable PhoneticExtensions()
        {
            return CodeChartHelper.GetRange(0x1d00, 0x1d7f);
        }

        public static IEnumerable PhoneticExtensionsSupplement()
        {
            return CodeChartHelper.GetRange(0x1d80, 0x1dbf);
        }

        public static IEnumerable Runic()
        {
            return CodeChartHelper.GetRange(0x16a0, 0x16f0);
        }

        public static IEnumerable Sudanese()
        {
            return CodeChartHelper.GetRange(0x1b80, 0x1bb9, i => (i >= 0x1bab) && (i <= 0x1bad));
        }

        public static IEnumerable Tagalog()
        {
            return CodeChartHelper.GetRange(0x1700, 0x1714, i => i == 0x170d);
        }

        public static IEnumerable Tagbanwa()
        {
            return CodeChartHelper.GetRange(0x1760, 0x1773, delegate (int i) {
                if (i != 0x176d)
                {
                    return i == 0x1771;
                }
                return true;
            });
        }

        public static IEnumerable TaiLe()
        {
            return CodeChartHelper.GetRange(0x1950, 0x1974, delegate (int i) {
                if (i != 0x196e)
                {
                    return i == 0x196f;
                }
                return true;
            });
        }

        public static IEnumerable TaiTham()
        {
            return CodeChartHelper.GetRange(0x1a20, 0x1aad, i => ((((i == 0x1a5f) || (i == 0x1a7d)) || (i == 0x1a7e)) || ((i >= 0x1a8a) && (i <= 0x1a8f))) || ((i >= 0x1a9a) && (i <= 0x1a9f)));
        }

        public static IEnumerable UnifiedCanadianAboriginalSyllabics()
        {
            return CodeChartHelper.GetRange(0x1400, 0x167f);
        }

        public static IEnumerable UnifiedCanadianAboriginalSyllabicsExtended()
        {
            return CodeChartHelper.GetRange(0x18b0, 0x18f5);
        }

        public static IEnumerable VedicExtensions()
        {
            return CodeChartHelper.GetRange(0x1cd0, 0x1cf2);
        }
    }
}

